<nav class="breadcrumb" id="pathContainer">
    <i class="Hui-iconfont Hui-iconfont-weizhi"></i>
    <span>您的位置：</span>
    <span>扶贫主体管理</span>
    <span class="c-999 en">&gt;</span>
    <span class="c-primary">帮扶单位管理</span>
</nav>
<div class="Hui-article" id="mainList">
    <div class="row cl searchBox " >
        <form class="form form-horizontal responsive" id="searchForm" novalidate="novalidate">
            <div class="clearfix">
                <div class="conditionBox col-sm-2">
                    <label for="">所在乡:</label>
                    <div class="formControls">
                        <select class="select-box select radius" size="1" id="cry" value="">
                            <option value="">请选择</option>
                        </select>
                        <input type="hidden" name="country" id="h-cry">
                    </div>
                </div>
                <div class="conditionBox col-sm-2">
                    <label for="ipt1">隶属关系:</label>
                    <div class="formControls">
                        <select class="select-box select radius" size="1" name="Affiliation" id="province" value="">
                            <option value="" selected>请选择</option>
                            <option value="县（区）">县（区）</option>
                            <option value="街道、镇、乡">街道、镇、乡</option>
                            <option value="军队">军队</option>
                            <option value="村两委">村两委</option>
                        </select>
                    </div>
                </div>
                <div class="conditionBox col-sm-2">
                    <label for="ipt2">单位名称:</label>
                    <input type="text" class="input-text radius" placeholder="请输入帮扶单位名称" name="Unit_name" id="Unit_name" />
                </div>
                <div class="conditionBox col-sm-2">
                    <label for="ipt2">联系人电话:</label>
                    <input type="text" class="input-text radius" placeholder="请输入联系电话" name="work_telephone" id="work_telephone" />
                </div>
            </div>
        </form>   
        <div class="clearfix search-btns margin-padding-none btn-div ">
            <input type="button" class="btn btn-primary query-btn btn-secondary float-left mr-4" value="查 询"/>
            <div class="f-l">
                <button type="button" class="btn btn-secondary add_btn">新增</button>
                <button type="button" class="btn btn-secondary detail_btn">查看</button>
                <button type="button" class="btn btn-secondary edit_btn ">编辑</button>
                <button type="button" class="btn btn-secondary del_btn mr-4 ">删除</button>
            </div>
            <div class="f-r float-left">
                <button type="button" class="btn btn-secondary pairing_btn ">结对</button>
                <button type="button" class="btn btn-secondary del_pairing_btn mr-4">结对解除</button>
            </div>
            <label for="file" class="btn btn-secondary import_btn" style="width: auto;">导入</label>
            <input class="btn btn-secondary" name="file" id="file" type="file" value="" style="display: none;">
        </div>
        
    </div>
    
    <!-- 帮扶单位 -->
    <div class="container clearfix posi-r h-85p">
        <div class="col-md-6 pr-20 border-right h-100p">
            <h4 class="pl-10 border-left-blue h-5p">帮扶单位</h4>
            <div class="table-scroll h-85p">
                <table class="table table-border table-bordered">
                    <thead class="text-c row cl table-bgcolor-gary" id="thead">
                        <tr>
                            <th></th>
                            <th>序号</th>
                            <th>行政区划</th>
                            <th>帮扶单位名称</th>
                            <th>帮扶单位类型</th>
                            <th>隶属关系</th>
                            <th>联系电话</th>
                            <th>联系人姓名</th>
                            <th>联系人电话</th>
                            <th>联系人地址</th>
                            <th>邮政编码</th>
                            <th>电子邮箱</th>  
                        </tr>
                    </thead>
                    <tbody class="text-c row cl" id="tbody1"></tbody>
                </table>
            </div>
            <div class="page pt-10 clearfix h-8p">
                <div class="f-l fs-08r" style="white-space: nowrap;" id="pageContainer"></div>
                <div class="f-r page-div w-37p h-20" id="pageBtn">
                    <input type="button" value="首页" class="page-btn" id="firstPage">
                    <input type="button" value="上一页" class="page-btn" id="prevPage">
                    <input type="button" value="下一页" class="page-btn" id="nextPage">
                    <input type="button" value="尾页" class="page-btn" id="lastPage">
                </div>
            </div>
            
        </div>
        <!-- 已结对行政村信息 -->
        <div class="col-md-6 pl-20 h-100p">
            <h4 class="pl-10 border-left-blue h-5p">已结对行政村信息</h4>
            <div class="table-scroll h-85p">
                <table class="table table-border table-bordered">
                    <thead class="text-c row cl table-bgcolor-gary" id="thead">
                        <tr>
                            <th></th>
                            <th>序号</th>
                            <th>行政村名称</th>
                            <th>行政区划</th>
                            <th>村负责人</th>
                            <th>村属性</th>
                            <th>村办公电话</th>
                        </tr>
                    </thead>
                    <tbody class="text-c row cl" id="tbody2"></tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- 新增、编辑、查看 弹窗 -->
<div style="display: none;" id="addPopup">
    <div class="Hui-article mt-10 i-mt-15" id="add">
        <form class="form form-horizontal responsive twinningAddForm" id="addForm" novalidate="novalidate"></form>
    </div> 
    <!-- localHbs -->
    <script id="addList" type="text/x-handlebars-template">
        <div class="box clearfix">
        	<!-- <input type="hidden" name="one_man" value="" placeholder="请输入制单人" class="input-text cl-input">
            <input type="hidden" name="card_time" value="" placeholder="请输入制单时间" class="input-text cl-input">
            <input type="hidden" name="modifier" value="" placeholder="请输入修改人" class="input-text cl-input">
            <input type="hidden" name="update_time" value="" placeholder="请输入修改时间" class="input-text cl-input">-->
            <div class="row cl inline-block cl-width">
                <label for="ipt2">单位编号</label>
                <input value="\{{unit_id}}" type="number" name="unit_id" placeholder="请输入单位编号" class="input-text cl-input mccms-validate-required mccms-validate-min?0 valid" style="width: 220px;" \{{#if detail}}disabled="disabled"\{{/if}} maxlength="6" >
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">所在省</label>
                <span class="select-box cl-span">
                    <select value="\{{province}}" class="select cl-select mccms-validate-required" size="1" name="province" id="province1" \{{#if detail}}disabled="disabled"\{{/if}}>
                      \{{#mccmsSelect province}}
                        <option value="">请选择</option>
                        \{{/mccmsSelect}}
                    </select>
                </span>
            </div>

            <div class="row cl inline-block cl-width">
                <label for="ipt2">所在市</label>
                <span class="select-box cl-span">
                    <select value="\{{city}}" class="select cl-select mccms-validate-required" size="1" name="city" id="city" \{{#if detail}}disabled="disabled"\{{/if}}>
                      \{{#mccmsSelect province}}
                        <option value="">请选择</option>
                        \{{/mccmsSelect}}
                    </select>
                </span>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">所在县</label>
                <span class="select-box cl-span">
                    <select value="\{{county}}" class="select cl-select mccms-validate-required" size="1" name="county" id="county" \{{#if detail}}disabled="disabled"\{{/if}}>
                      \{{#mccmsSelect province}}
                        <option value="">请选择</option>
                        \{{/mccmsSelect}}
                    </select>
                </span>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">所在乡</label>
                <span class="select-box cl-span">
                    <select value="\{{country}}" class="select cl-select mccms-validate-required" size="1" name="country" id="country" \{{#if detail}}disabled="disabled"\{{/if}}>
                      \{{#mccmsSelect province}}
                        <option value="">请选择</option>
                        \{{/mccmsSelect}}
                    </select>
                </span>
            </div>

            <div class="row cl inline-block cl-width">
                <label for="ipt2">单位名称</label>
                <input type="text" name="unit_name" value="\{{unit_name}}" placeholder="请输入单位名称" class="input-text cl-input mccms-validate-required" \{{#if detail}}disabled="disabled"\{{/if}}>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">单位类型</label>
                <span class="select-box cl-span">
                    <select class="select cl-select mccms-validate-required" size="1" name="unit_type" value="\{{unit_type}}" \{{#if detail}}disabled="disabled"\{{/if}}>
                      \{{#mccmsSelect unit_type}}
                      <option value="" selected>请选择</option>
                      <option value="国家机关">国家机关</option>
                      <option value="社会团体">社会团体</option>
                      <option value="高等院校">高等院校</option>
                      <option value="国有企业">国有企业</option>
                      <option value="东部对口帮扶省市">东部对口帮扶省市</option>
                      <option value="定点机构">定点机构</option>
                      <option value="事业单位">事业单位</option>
                      <option value="村民自治组织">村民自治组织</option>
                        \{{/mccmsSelect}}
                    </select>
                </span>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">隶属关系</label>
                <span class="select-box cl-span">
                    <select class="select cl-select mccms-validate-required" size="1" name="affiliation" value="affiliation" \{{#if detail}}disabled="disabled"\{{/if}}>
                  \{{#mccmsSelect affiliation}}
                      <option value="" selected>请选择</option>
                      <option value="县（区）">县（区）</option>
                      <option value="街道、镇、乡">街道、镇、乡</option>
                      <option value="军队">军队</option>
                      <option value="村两委">村两委</option>
                    \{{/mccmsSelect}}
                    </select>
                </span>
            </div>

            <div class="row cl inline-block cl-width">
                <label for="ipt2">单位电话</label>
                <input value="\{{work_telephone}}" type="text" name="work_telephone" placeholder="请输入单位电话" class="input-text cl-input telephone" \{{#if detail}}disabled="disabled"\{{/if}}>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">联系人</label>
                <input value="\{{contacts}}" type="text" name="contacts" placeholder="请输入联系人" class="input-text cl-input" \{{#if detail}}disabled="disabled"\{{/if}}>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">联系人电话</label>
                <input value="\{{contact_phone}}" type="text" name="contact_phone" placeholder="请输入联系人电话" class="input-text cl-input telephone" \{{#if detail}}disabled="disabled"\{{/if}}>
            </div>

            <div class="row cl inline-block cl-width">
                <label for="ipt2">单位地址</label>
                <input value="\{{unit_address}}" type="text" name="unit_address" placeholder="请输入单位地址" class="input-text cl-input" \{{#if detail}}disabled="disabled"\{{/if}}>
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">邮政编码</label>
                <input value="\{{postal_Code}}" type="tel" name="postal_Code" placeholder="请输入邮政编码" class="input-text cl-input stringCheck2 number" \{{#if detail}}disabled="disabled"\{{/if}} maxlength="6"  />
            </div>
            <div class="row cl inline-block cl-width">
                <label for="ipt2">电子邮箱</label>
                <input value="\{{mail_box}}" type="text" name="mail_box" placeholder="请输入电子邮箱" class="input-text cl-input email" \{{#if detail}}disabled="disabled"\{{/if}}>
            </div>
            
            <div style="text-align: center;" class="pt-30" \{{#if detail}}hidden\{{/if}}>
                <button type="button" class="btn btn-secondary size-L sub_btn">保 存</button>
            </div>
            
        </div>
    </script>
</div>

<!-- 结对 -->
<div style="display: none;height: 100%" id="twinningPopup">
    <form id="twinning">
        <div class="border-bottom pb-5 area" >
            <div class="row cl inline-block innset-wrapper i-mt-5">
                <label for="">所在省</label>
                <span class="select-box innset-span">
                  <select class="select innset-input" size="1" name="province" id="province2">
                    <option value="河北省">河北省</option>
                  </select>
                </span>
            </div>
            <div class="row cl inline-block innset-wrapper i-mt-5">
                <label for="">所在市</label>
                <span class="select-box innset-span">
                  <select class="select innset-input" size="1" name="city" id="city2">
                      <option value="邯郸市">邯郸市</option>
                  </select>
                </span>
            </div>
            <div class="row cl inline-block innset-wrapper i-mt-5">
                <label for="ipt1">所在县</label>
                <span class="select-box innset-span">
                  <select class="select innset-input" size="1" name="cty" id="cty2">
                      <option value="魏县">魏县</option>
                  </select>
                </span>
            </div>
            <div class="row cl inline-block innset-wrapper i-mt-5">
                <label for="ipt1">所在乡</label>
                <span class="select-box innset-span">
                  <select class="select innset-input" size="1" name="cry" id="cry2">
                    <option value="" selected>请选择</option>
                  </select>
                </span>
            </div>
            <div class="row cl inline-block innset-wrapper i-mt-5">
                <label for="ipt1">所在村</label>
                <span class="select-box innset-span">
                  <select class="select innset-input" size="1" name="name" id="name2">
                    <option value="" selected>请选择</option>
                  </select>
                </span>
            </div>
        </div>
       
    </form> 
    <div class="form responsive" id="twinningForm" novalidate="novalidate" style="height: 90%">
         <div class="pt-5 pl-40 pr-40 pb-10" style="height: 79%">
        <h4 class="pl-10 border-left-blue">行政村信息</h4>
        <div style="margin-top:0px;overflow: scroll;height: 90%">
            <form action="" class="form-list" id="form-list">
                <table class="table table-border table-bordered">
                    <thead class="text-c row cl table-bgcolor-gary" id="thead">
                        <tr>
                            <th><input type="checkbox" id="checkAll" value="" class="checkbox" /></th>
                            <th>序号</th>
                            <th>县</th>
                            <th>乡</th>
                            <th>村名字</th>
                            <th>负责人</th>
                            <th>职务</th>
                            <th>联系方式</th>
                            <th>村属性</th>
                            <th>发展方向</th>
                            <th>地形地貌</th>
                            <th>中共党员数</th>
                            <th>村官人数</th>
                        </tr>
                    </thead>
                    <tbody class="text-c row cl" id="tbody3"></tbody>
                </table>
            </form>
        </div>

        <!-- <div class="page pt-10 clearfix h-8p">
            <div class="f-l fs-08r" style="white-space: nowrap;" id="pageContainer2"></div>
            <div class="f-r page-div w-37p h-20" id="pageBtn">
                <input type="button" value="首页" class="page-btn" id="firstPage2">
                <input type="button" value="上一页" class="page-btn" id="prevPage2">
                <input type="button" value="下一页" class="page-btn" id="nextPage2">
                <input type="button" value="尾页" class="page-btn" id="lastPage2">
            </div>
        </div> -->
        
    </div>
    <div style="position: relative">
        <div id="layPage3" class="text-c data-cache layPage"></div>
        <button type="button" class="btn btn-secondary size-L pairing_sub_btn" style="position: absolute;right: 60px;top: 0px;">结对</button>
    </div>
    </div> 
</div>

<!-- 帮扶单位与行政村结对模板 -->
<!-- <script id="twinningList" type="text/x-handlebars-template">
   
</script> -->

<!-- 帮扶单位模板 -->
<script id="list1" type="text/x-handlebars-template">
    \{{#each resultList}}
    <tr>
        <td><input type="radio" name="radio" id="\{{id}}"></td>
        <td>\{{Math @index '+' '1'}}</td>
        <td>\{{province}}\{{city}}\{{county}}\{{country}}</td>
        <td>\{{unitName}}</td>
        <td>\{{unitType}}</td>
        <td>\{{affiliation}}</td>
        <td>\{{tel}}</td>
        <td>\{{contacts}}</td>
        <td>\{{ContactTel}}</td>
        <td>\{{address}}</td>
        <td>\{{postCode}}</td>
        <td>\{{mail}}</td>
    </tr>
    \{{/each}}
</script>
<!-- 已结对行政村模板 -->
<script id="list2" type="text/x-handlebars-template">
    \{{#each result}}
    <tr>
        <td><input type="checkbox" name="checkbox" id="\{{id}}"></td>
        <td>\{{Math @index '+' '1'}}</td>
        <td>\{{name}}</td>
        <td>\{{province}}\{{city}}\{{county}}</td>
        <td>\{{fpeople}}</td>
        <td>\{{nature}}</td>
        <td>\{{contact}}</td>
    </tr>
    \{{/each}}
</script>
<!-- 帮扶单位分页模板 -->
<script id="page" type="text/x-handlebars-template">
    <span>共有\{{rowCount}}条记录，</span>
    <label>每页行数：</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageSize">
            <option value="10" selected>10</option>
            <option value="20">20</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="200">200</option>
            <option value="300">300</option>
        </select>
    </span>
    <label>当前第</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageCount">
            \{{#each pageCount}}
            <option value="\{{pageCount}}">\{{pageCount}}</option>
            \{{/each}}
        </select>
    </span>
    <span>页</span>
</script>

<!-- 弹窗分页模板 -->
<!-- <script id="page2" type="text/x-handlebars-template">
    <span>共有\{{rowCount}}条记录，</span>
    <label>每页行数：</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageSize2">
            <option value="10" selected>10</option>
            <option value="20">20</option>
            <option value="50">50</option>
            <option value="100">100</option>
            <option value="200">200</option>
            <option value="300">300</option>
        </select>
    </span>
    <label>当前第</label>
    <span class="select-box page-span">
        <select class="select page-select" size="1" name="demo1" id="pageCount2">
            \{{#each pageCount}}
            <option value="\{{pageCount}}">\{{pageCount}}</option>
            \{{/each}}
        </select>
    </span>
    <span>页</span>
</script> -->

<!-- 结对模板 -->
<script id="list3" type="text/x-handlebars-template">
    \{{#each resultList}}
    <tr>
        <td><input type="checkbox" name="checkbox3" id="\{{id}}" class="checkbox"></td>
        <td>\{{Math @index '+' '1'}}</td>
        <td>\{{cty}}</td>
        <td>\{{cry}}</td>
        <td>\{{name}}</td>
        <td>\{{fpeople}}</td>
        <td>\{{post}}</td>
        <td>\{{contact}}</td>
        <td>\{{nature}}</td>
        <td>\{{development}}</td>
        <td>\{{terrain}}</td>
        <td>\{{party}}</td>
        <td>\{{officer}}</td>
    </tr>
    \{{/each}}
</script>

<script>
    new helpUnitMng(); //帮扶单位
</script>